<?php 
namespace app\api\controller\v1;
use app\api\service\MarketService;

class Market extends Base {
    
    protected $service;
    public function __construct(MarketService $service)
    {
        parent::__construct();
        $this->service = $service;
    }

    // 显示
    public function index($page = 1, $size = 10) {
        return show(1, '成功', $this->service->page($page, $size), 200);
    }

    // 修改 添加
    public function save() {
        return $this->service->save();
    }

    // 删除
    public function delete($id) {
        return $this->service->delete($id);
    }

    // 轮询
    public function polling() {
        return $this->service->polling();
    }

    // 知道后不通知与删除
    public function change(){
        return $this->service->change();
    }
    
}